//
//  LSZDynamicClassificationManager.m
//  JKFuYinProject
//
//  Created by 九酷 on 2018/8/20.
//  Copyright © 2018年 LC. All rights reserved.
//

#import "LSZDynamicClassificationManager.h"

@implementation LSZDynamicClassificationManager
-(id)initWithDynamicClassification :(NSDictionary *)dic
{
    self = [super init];
    if (self) {
        self.mutMgArray  = [[NSMutableArray alloc]init];
        self.mutNameArray = [[NSMutableArray alloc]init];
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSString class]]) {
            return self;
        }
        if ([[dic valueForKey:@"data"] isKindOfClass:[NSNumber class]]) {
            return self;
        }
        if (![dic valueForKey:@"data"]) {
            return self;
        }
        NSArray * arrayData = dic[@"data"];
        NSMutableArray * arrayMg = [[NSMutableArray alloc]init];
        NSMutableArray * arrayMame = [[NSMutableArray alloc]init];
        for (NSDictionary * diction in arrayData) {
            LSZDynamicClassificationMg * mg = [[LSZDynamicClassificationMg alloc]init];
            mg.id_id = NullStringjudgment(NSStr(diction[@"id"]));
            mg.name = NullStringjudgment(NSStr(diction[@"name"]));
            mg.count = NullStringjudgment(NSStr(diction[@"count"]));
//            mg.theme = NullStringjudgment(NSStr(diction[@"theme"]));
//            mg.logo_androd = NullStringjudgment(NSStr(diction[@"logo_androd"]));
//            mg.logo_ios = NullStringjudgment(NSStr(diction[@"logo_ios"]));
            mg.sort_order = NullStringjudgment(NSStr(diction[@"sort_order"]));
            mg.discrib = NullStringjudgment(NSStr(diction[@"discrib"]));
            mg.images = diction[@"images"];
            id logo_main = diction[@"logo_main"];
            id logo_more = diction[@"logo_more"];
            if ([logo_main isKindOfClass:[NSArray class]]) {
                mg.logo_main = logo_main;
            }
            if ([logo_more isKindOfClass:[NSArray class]]) {
                mg.logo_more = logo_more;
            }
            [arrayMg addObject:mg];
            [arrayMame addObject:mg.name];
        }
        self.mutMgArray = arrayMg;
        self.mutNameArray = arrayMame;
    }
    return self;
}
@end
@implementation LSZDynamicClassificationMg
@end
